import React from 'react';
import { MenuTrigger } from '@design/core/components/ContextMenu';

export default (options = {}) => {
  const { menus = [] } = options;
  return Comp => {
    return props => {
      const renderMenuTrigger = children => {
        return (
          <MenuTrigger
            {...props}
            menus={menus}
            menuId="desktop-context-menu"
            style={{ width: '100%', height: '100%' }}
          >
            {children}
          </MenuTrigger>
        );
      };
      return <Comp {...props} renderMenuTrigger={renderMenuTrigger} />;
    };
  };
};
